package Controller.reply;

import java.util.List;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;

import org.springframework.web.servlet.ModelAndView;
import org.springframework.web.servlet.mvc.Controller;

import Bean.ReplyBean;
import Dao.ReplyDao;

public class ReplyreplyUpdateController implements Controller{
	private ReplyDao dao;
	public void setDao(ReplyDao dao) {
		this.dao = dao;
	}
	@Override
	public ModelAndView handleRequest(HttpServletRequest req,
			HttpServletResponse arg1) throws Exception {
		Integer sr_no = Integer.parseInt(req.getParameter("sr_no"));
		System.out.println("업데이트에 들어온 시퀀스 값 : "+ sr_no);
		
		List<ReplyBean> updateform = dao.replyUpdate(sr_no);
		for (ReplyBean reBean : updateform) {
			System.out.println("qweqweqwe");
			System.out.println("업데이트를 위한 조회 결과 : "+reBean.getSr_context());
			System.out.println("업데이트를 위한 조회 결과 : "+reBean.getSr_m_id());
			System.out.println("업데이트를 위한 조회 결과 : "+reBean.getSr_no());	
		}
		
		ModelAndView mav = new ModelAndView();
		mav.setViewName("replyUpdate");
		mav.addObject("update", updateform);
		return mav;
	}

}
